import http from '@/plugins/axios'

export interface Menu {
  id?: string
  name: string
  icon?: string
  url?: string
  perms?: string
  list?: Menu[]
}

// 获取菜单
export function getMenus(): Promise<Menu[]> {
  return http({
    method: 'GET',
    url: '/sys/menu/nav'
  })
}

// 获取用户信息
export function getUserInfo() {
  return http({
    method: 'POST',
    url: '/sys/user/personalInfo'
  })
}

// 退出登录
export function logout() {
  return http({
    method: 'POST',
    url: '/sys/logout'
  })
}

// 跟新密码

export function updatePassword(data) {
  return http({
    method: 'POST',
    url: '/sys/updatePassword',
    data
  })
}
